package com.margo.project.consumer.kafka.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.support.converter.StringJsonMessageConverter;


/**
 * 
 * 接受消息报错
 * 1)Caused by: java.lang.IllegalStateException: 
 * No group.id found in consumer config, container properties, or @KafkaListener annotation; 
 * a group.id is required when group management is used.
 * 
 * 2)org.springframework.messaging.converter.MessageConversionException: 
 * Cannot handle message; nested exception is org.springframework.messaging.converter.MessageConversionException: 
 * Cannot convert from [java.lang.String] to 
 * [com.margo.project.consumer.common.model.EasydlDiscernMessageVO] for GenericMessage
 * @author fxb208
 *
 */
@Configuration
@EnableKafka
public class KafkaConsumerConfiguration {
	@Bean
	public StringJsonMessageConverter jsonConverter() {
	        return new StringJsonMessageConverter();
	}
}
